[RFC] haskell build recipe updates#6955
Draft
liontiger23 wants to merge 4 commits intogetsolus:mainfrom
Draft
Conversation
**Summary** - Update build recipe to use `%haskell-*` macros instead of raw cabal as discussed at getsolus#6540 (comment) - Disable parallel build due to weird bug in cabal/ghc - Replace `.cabal` patch file with `--constraint` argument - Enable running tests by explicitly providing `hspec-discover`
**Summary** - Update build recipe to use `%haskell-*` macros instead of raw cabal as discussed at getsolus#6540 (comment) - Switch to hackage source for `pandoc-cli` specifically instead of whole pandoc repo
**Summary** - Switch to hackage source for `pandoc-crossref` to avoid ugly hack with rm of `cabal.project.freeze`
**Summary** - Update build recipe to use `%haskell-*` macros instead of raw cabal as discussed at getsolus#6540 (comment) - Tests are disabled because they require following dependencies - [Icarus Verilog](https://steveicarus.github.io/iverilog/) - for Verilog simulation - [shUnit2](https://github.com/kward/shunit2) - test framework
Contributor
Author
|
@GZGavinZhao please take a look I tried to switch remaining packages to I am thinking that we could introduce several more macros:
|
liontiger23
commented
Nov 9, 2025
| %cabal_configure -f+tar -f+tui --enable-tests | ||
| %cabal_configure -f+tar -f+tui --enable-tests \ | ||
| --constraint='brick >=2.5 && <2.8' | ||
| cabal install hspec-discover |
Contributor
Author
There was a problem hiding this comment.
Could be %cabal_install_build_tool hspec-discover
| mkdir -p $installdir/usr/bin | ||
| cabal install --installdir=$installdir/usr/bin --install-method=copy exe:ghcup | ||
| %haskell_install exe:ghcup | ||
| rm -rf $installdir/%libdir% |
Contributor
Author
There was a problem hiding this comment.
Maybe we can also bundle this rm -rf somewhere into %haskell_install_exe or something like that?
| setup : | | ||
| rm $workdir/cabal.project.freeze | ||
| %cabal_configure --enable-tests | ||
| %cabal_configure --constraint="crypton-x509-store == 1.6.11" --enable-tests |
Contributor
Author
There was a problem hiding this comment.
Here %cabal_configure works because --constraint contains only version specification
| --disable-executable-dynamic \ | ||
| --ghc-options="-H512m %JOBS%" \ | ||
| -f embed_data_files | ||
| cabal build %JOBS% --only-dependencies --disable-tests -O2 --ghc-options="-H128m %JOBS%" \ |
Contributor
Author
There was a problem hiding this comment.
This could be
%cabal_build_dependencies --constraint="crypton-x509-store == 1.6.11" \
--constraint="pandoc +embed_data_files"
%haskell_configure_exe
| export CABAL_DIR="$HOME/.cabal" | ||
| cabal update | ||
| cabal configure -O2 %JOBS% --disable-executable-dynamic | ||
| cabal install alex happy |
Contributor
Author
There was a problem hiding this comment.
Could be %cabal_install_build_tool alex happy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This is independent of Upgrade of Haskell stack
Summary
Switched all remaining haskell packages that did not use
%haskell_*macros to use them.However, this highlighted some issues with expressiveness of current macros.
I had to use cabal directly for following tasks:
alex,happyandhspec-discover,which
runhaskell Setup.hsdoes not build due to issuerunhaskell Setup.hsapparentlyonly supports version bounds in
--constraintand not setting flags as well(needed for
pandocbuild with--constraint="pandoc +embed_data_files")Below are summaries for each package:
%haskell-*macros instead of raw cabalas discussed at ghcup: Add at v0.1.50.2 #6540 (comment)
.cabalpatch file with--constraintargumenthspec-discover%haskell-*macros instead of raw cabalas discussed at ghcup: Add at v0.1.50.2 #6540 (comment)
pandoc-clispecifically instead of whole pandoc repopandoc-crossrefto avoid ugly hack with rm ofcabal.project.freeze%haskell-*macros instead of raw cabalas discussed at ghcup: Add at v0.1.50.2 #6540 (comment)
Checklist